[C# .NET6] AutoFac ADD implementation after DI Container Resolve


If you want to Add a implementation after DI Container resolved already,
you need to create a newBuilder and Update it to the original Container.

                var newBuilder = new ContainerBuilder();
                newBuilder.Register(c =>  new Car {Seats = GetSeats().Split(',') }).As<ICar>();
                newBuilder.Update(OriginalDIContainer);
#C# #.net6 #.net






你可能感興趣的文章

Command Line 基本指令

Command Line 基本指令

第二章:1 打造八種趨勢交易策略

第二章:1 打造八種趨勢交易策略

現有建築光電發電投資的實質選擇權估值

現有建築光電發電投資的實質選擇權估值






留言討論